
/**
 * @Title: PictureController.java
 * @Package org.car.world.controller
 * @Description: TODO(用一句话描述该文件做什么)
 * @author dell
 * @date 2018年11月8日
 * @version V1.0
 */

package org.car.world.controller;

import java.util.List;

import org.car.world.core.entily.PictureTable;
import org.car.world.service.impl.PictureServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @ClassName: PictureController
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author dell
 * @date 2018年11月8日
 *
 */
@Controller
public class PictureController {
    @Autowired
    PictureServiceImpl pictureService;

    @GetMapping("goto_newslist")
    public String doNewsList(Model model) {
        List<PictureTable> list = pictureService.selectAll();
        model.addAttribute("list", list);
        return "news";
    }

    @GetMapping("goto_newsinfo")
    public String doNewsInfo(Integer informationId, Model model) {
        PictureTable pic = pictureService.selectByPrimaryKey(informationId);
        model.addAttribute("pic", pic);
        System.out.println(pic.getInformationText());
        return "newsinfo";
    }


}
